import request from '@/request/request'

// 创建订单
export function createOrders(data) {
    return request({
        url: '/system/orders/create',
        method: 'post',
        data: data
    })
}

// 更新订单
export function updateOrders(data) {
    return request({
        url: '/system/orders/update',
        method: 'put',
        data: data
    })
}

// 删除订单
export function deleteOrders(id) {
    return request({
        url: '/system/orders/delete?id=' + id,
        method: 'delete'
    })
}

// 获得订单
export function getOrders(id) {
    return request({
        url: '/system/orders/get?id=' + id,
        method: 'get'
    })
}

// 获得订单分页
export function getOrdersPage(params) {
    return request({
        url: '/system/orders/page',
        method: 'post',
        data:params
    })
}
export function getOrdersPageByCart(params) {
    return request({
        url: '/system/orders/page/byCrt',
        method: 'post',
        data:params
    })
}

export function playOrder(params) {
    return request({
        url: '/system/play/order',
        method: 'post',
        data:params
    })
}
// 导出订单 Excel
export function exportOrdersExcel(params) {
    return request({
        url: '/system/orders/export-excel',
        method: 'get',
        params,
        responseType: 'blob'
    })
}
